public class code5_4 {
    //不能踩到第 7 阶及其倍数
    public int climbStairsM(int n,int m) {
        int[] dp = new int[n+1];
        dp[0] = 1;//什么都不做也是一种方案
        for (int i = 1; i <= n; i++) {
            if(i % 7 == 0) {
                dp[i] = 0;//禁止踩到
                continue;
            }
            for (int j = 1; j <= m; j++) {
                if(i-j>=0) {
                    dp[i] += dp[i-j];
                }
            }
        }
        return dp[n];
    }
}
